from django.db import models
from doctor.models import Doctor
from patient.models import Patient
from medicine.models import Medicine
from prescription.models import Prescription
# Create your models here.
class Medicine_use(models.Model):

    description = models.TextField(null=True,blank=True)

    dosage = models.TextField(null=True,blank=True)

    frequency = models.TextField(null=True,blank=True)

    num = models.IntegerField(null=True,blank=True)

    medicine_id = models.ForeignKey(Medicine, on_delete=models.CASCADE)

    prescription_id = models.ForeignKey(Prescription, on_delete=models.CASCADE)

    pay_status = models.CharField(
        max_length=20,
        choices=[
            ('paid', '已缴费'),
            ('pending', '未交费'),
            ('refund', '已退费'),
        ],
        default='pending'
    )

    take_status = models.CharField(
        max_length=20,
        choices=[
            ('take', '已取'),
            ('untake', '未取'),
            ('refund', '已退'),
        ],
        default='untake'
    )